/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.scrumpmt.web;

import java.io.Serializable;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.enterprise.context.SessionScoped;
import javax.faces.bean.ManagedBean;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.scrumpmt.domain.TipoTarea;
import org.scrumpmt.ejb.TipoTareaFacade;

/**
 *
 * @author Emilio
 */
@ManagedBean(name = "listadoTiposTareasBean")
@SessionScoped
public class ListadoTiposTareasBean implements Serializable {
    //@EJB
   // private TipoTareaFacadeLocal tipoTareaFacade;
  
    
    private TipoTareaFacade tipoTareaFacade = lookupTipoTareaFacade();
    private List<TipoTarea> listado;

   private static final Logger log = Logger.getLogger(ListadoTiposTareasBean.class.getName());
    
    /**
     * Creates a new instance of ListadoTiposTareasBean
     */
    public ListadoTiposTareasBean() {
        
        listado=tipoTareaFacade.findAll();
        
    }
    
      public List<TipoTarea> getListado() {
          
          return listado;
    }

    public void setListado(List<TipoTarea> listado) {
        this.listado = listado;
    }
    
    private TipoTareaFacade lookupTipoTareaFacade() {
        try {
            Context c = new InitialContext();
            return (TipoTareaFacade) c.lookup("java:global/ScrumPMT/ScrumPMT-ejb/TipoTareaFacade!org.scrumpmt.ejb.TipoTareaFacade");
        } catch (NamingException ne) {
            log.log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }
}
